package com.dragon.modules.yuegou.query.coupon;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.dragon.modules.yuegou.entity.coupon.WelfareRecordEntity;
import com.dragon.modules.yuegou.mybatis.Condition;
import com.dragon.modules.yuegou.mybatis.Query;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonInclude.Include;
import com.fasterxml.jackson.annotation.JsonUnwrapped;

import java.time.LocalDateTime;

/**
 * 优惠券福利信息领取记录表 动态查询条件
 * 
 * @author pbuilder generated
 * @date 2019-10-14 15:16:14
 * @version 2.0
 */
@JsonInclude(Include.NON_NULL)
public class WelfareRecordQuery extends WelfareRecordEntity implements Query<WelfareRecordEntity> {

    /** 查询条件 */
	@JsonUnwrapped(prefix = "id")
	private Condition<String> idCondition;

    /** 商圈ID查询条件 */
	@JsonUnwrapped(prefix = "busdId")
	private Condition<String> busdIdCondition;

    /** 福利ID查询条件 */
	@JsonUnwrapped(prefix = "welfareId")
	private Condition<String> welfareIdCondition;

    /** 券模板ID查询条件 */
	@JsonUnwrapped(prefix = "couponTemplateId")
	private Condition<String> couponTemplateIdCondition;

    /** 领取会员查询条件 */
	@JsonUnwrapped(prefix = "memberId")
	private Condition<String> memberIdCondition;

    /** 优惠券ID查询条件 */
	@JsonUnwrapped(prefix = "couponId")
	private Condition<String> couponIdCondition;

    /** 领取时间查询条件 */
	@JsonUnwrapped(prefix = "receiveTime")
	private Condition<LocalDateTime> receiveTimeCondition;

	/**
	 * 构造一个查询条件对象
	 */
	public WelfareRecordQuery() {
		super();
	}

	/**
	 * 依据实体对象构造一个查询条件对象
	 * 
	 * @param entity 实体对象
	 */
	public WelfareRecordQuery(WelfareRecordEntity entity) {
		super(entity);
	}

	/**
	 * 依据其它查询条件对象的信息构造一个查询条件对象
	 * 
	 * @param other 查询条件对象
	 */
	public WelfareRecordQuery(WelfareRecordQuery other) {
		super(other);
		if(other.idCondition != null) {
			this.idCondition = other.idCondition.copy();
		}
		if(other.busdIdCondition != null) {
			this.busdIdCondition = other.busdIdCondition.copy();
		}
		if(other.welfareIdCondition != null) {
			this.welfareIdCondition = other.welfareIdCondition.copy();
		}
		if(other.couponTemplateIdCondition != null) {
			this.couponTemplateIdCondition = other.couponTemplateIdCondition.copy();
		}
		if(other.memberIdCondition != null) {
			this.memberIdCondition = other.memberIdCondition.copy();
		}
		if(other.couponIdCondition != null) {
			this.couponIdCondition = other.couponIdCondition.copy();
		}
		if(other.receiveTimeCondition != null) {
			this.receiveTimeCondition = other.receiveTimeCondition.copy();
		}
	}

	@Override
	public QueryWrapper<WelfareRecordEntity> toQueryWrapper() {
		QueryWrapper<WelfareRecordEntity> wrapper = new QueryWrapper<>(this);
		if (idCondition != null) {
			idCondition.toWrapper(wrapper, COL_ID);
		}
		if (busdIdCondition != null) {
			busdIdCondition.toWrapper(wrapper, COL_BUSD_ID);
		}
		if (welfareIdCondition != null) {
			welfareIdCondition.toWrapper(wrapper, COL_WELFARE_ID);
		}
		if (couponTemplateIdCondition != null) {
			couponTemplateIdCondition.toWrapper(wrapper, COL_COUPON_TEMPLATE_ID);
		}
		if (memberIdCondition != null) {
			memberIdCondition.toWrapper(wrapper, COL_MEMBER_ID);
		}
		if (couponIdCondition != null) {
			couponIdCondition.toWrapper(wrapper, COL_COUPON_ID);
		}
		if (receiveTimeCondition != null) {
			receiveTimeCondition.toWrapper(wrapper, COL_RECEIVE_TIME);
		}
		return wrapper;
	}

	/**
	 * 构造并返回查询条件
	 * 
	 * @return idCondition 查询条件
	 */
	public Condition<String> id() {
		this.idCondition = new Condition<>();
		return this.idCondition;
	}
	
	/**
	 * 获取查询条件
	 * 
	 * @return idCondition 查询条件
	 */
	public Condition<String> getIdCondition() {
		return idCondition;
	}

	/**
	 * 设置查询条件
	 * 
	 * @param idCondition 查询条件
	 */
	public void setIdCondition(Condition<String> idCondition) {
		this.idCondition = idCondition;
	}

	/**
	 * 构造并返回商圈ID查询条件
	 * 
	 * @return busdIdCondition 商圈ID查询条件
	 */
	public Condition<String> busdId() {
		this.busdIdCondition = new Condition<>();
		return this.busdIdCondition;
	}
	
	/**
	 * 获取商圈ID查询条件
	 * 
	 * @return busdIdCondition 商圈ID查询条件
	 */
	public Condition<String> getBusdIdCondition() {
		return busdIdCondition;
	}

	/**
	 * 设置商圈ID查询条件
	 * 
	 * @param busdIdCondition 商圈ID查询条件
	 */
	public void setBusdIdCondition(Condition<String> busdIdCondition) {
		this.busdIdCondition = busdIdCondition;
	}

	/**
	 * 构造并返回福利ID查询条件
	 * 
	 * @return welfareIdCondition 福利ID查询条件
	 */
	public Condition<String> welfareId() {
		this.welfareIdCondition = new Condition<>();
		return this.welfareIdCondition;
	}
	
	/**
	 * 获取福利ID查询条件
	 * 
	 * @return welfareIdCondition 福利ID查询条件
	 */
	public Condition<String> getWelfareIdCondition() {
		return welfareIdCondition;
	}

	/**
	 * 设置福利ID查询条件
	 * 
	 * @param welfareIdCondition 福利ID查询条件
	 */
	public void setWelfareIdCondition(Condition<String> welfareIdCondition) {
		this.welfareIdCondition = welfareIdCondition;
	}

	/**
	 * 构造并返回券模板ID查询条件
	 * 
	 * @return couponTemplateIdCondition 券模板ID查询条件
	 */
	public Condition<String> couponTemplateId() {
		this.couponTemplateIdCondition = new Condition<>();
		return this.couponTemplateIdCondition;
	}
	
	/**
	 * 获取券模板ID查询条件
	 * 
	 * @return couponTemplateIdCondition 券模板ID查询条件
	 */
	public Condition<String> getCouponTemplateIdCondition() {
		return couponTemplateIdCondition;
	}

	/**
	 * 设置券模板ID查询条件
	 * 
	 * @param couponTemplateIdCondition 券模板ID查询条件
	 */
	public void setCouponTemplateIdCondition(Condition<String> couponTemplateIdCondition) {
		this.couponTemplateIdCondition = couponTemplateIdCondition;
	}

	/**
	 * 构造并返回领取会员查询条件
	 * 
	 * @return memberIdCondition 领取会员查询条件
	 */
	public Condition<String> memberId() {
		this.memberIdCondition = new Condition<>();
		return this.memberIdCondition;
	}
	
	/**
	 * 获取领取会员查询条件
	 * 
	 * @return memberIdCondition 领取会员查询条件
	 */
	public Condition<String> getMemberIdCondition() {
		return memberIdCondition;
	}

	/**
	 * 设置领取会员查询条件
	 * 
	 * @param memberIdCondition 领取会员查询条件
	 */
	public void setMemberIdCondition(Condition<String> memberIdCondition) {
		this.memberIdCondition = memberIdCondition;
	}

	/**
	 * 构造并返回优惠券ID查询条件
	 * 
	 * @return couponIdCondition 优惠券ID查询条件
	 */
	public Condition<String> couponId() {
		this.couponIdCondition = new Condition<>();
		return this.couponIdCondition;
	}
	
	/**
	 * 获取优惠券ID查询条件
	 * 
	 * @return couponIdCondition 优惠券ID查询条件
	 */
	public Condition<String> getCouponIdCondition() {
		return couponIdCondition;
	}

	/**
	 * 设置优惠券ID查询条件
	 * 
	 * @param couponIdCondition 优惠券ID查询条件
	 */
	public void setCouponIdCondition(Condition<String> couponIdCondition) {
		this.couponIdCondition = couponIdCondition;
	}

	/**
	 * 构造并返回领取时间查询条件
	 * 
	 * @return receiveTimeCondition 领取时间查询条件
	 */
	public Condition<LocalDateTime> receiveTime() {
		this.receiveTimeCondition = new Condition<>();
		return this.receiveTimeCondition;
	}
	
	/**
	 * 获取领取时间查询条件
	 * 
	 * @return receiveTimeCondition 领取时间查询条件
	 */
	public Condition<LocalDateTime> getReceiveTimeCondition() {
		return receiveTimeCondition;
	}

	/**
	 * 设置领取时间查询条件
	 * 
	 * @param receiveTimeCondition 领取时间查询条件
	 */
	public void setReceiveTimeCondition(Condition<LocalDateTime> receiveTimeCondition) {
		this.receiveTimeCondition = receiveTimeCondition;
	}

}
